package com.fqgj.xjd.user.dao;

import com.fqgj.common.api.Page;
import com.fqgj.common.base.BaseMapper;
import com.fqgj.xjd.user.entity.UserAuthPanEntity;
import com.fqgj.xjd.user.entity.business.UserPanStatisticsEntity;

import java.util.Date;
import java.util.List;

/**
 * User: liuming
 * Date: 2018-08-17
 * Time: 16:26:12.277
 */
public interface UserAuthPanDao extends BaseMapper<UserAuthPanEntity> {

    /**
     * 获取用户PanCard
     *
     * @param userCode
     * @return
     */
    UserAuthPanEntity selectUserPanByUserCode(String userCode);

    /**
     * 获取用户PanCard
     */
    UserAuthPanEntity selectUserPanByPanNo(String cardNo);

    List<UserAuthPanEntity> selectUserPansByPanNo(String cardNo);

    List<UserAuthPanEntity> selectUserPansByMD5PanNo(String md5CardNo);

    /**
     * 更新用户pan的状态和url
     *
     * @param userAuthPanEntity
     */
    void updatePanStatusAndUrl(UserAuthPanEntity userAuthPanEntity);

    /**
     * pancard 调用次数统计
     *
     * @param startDate
     * @param endDate
     * @return
     */
    List<UserPanStatisticsEntity> selectUserPanStatistics(Date startDate, Date endDate);

    List<UserAuthPanEntity> selectListByPage(Page page, Date endDate);
}